﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class GetServices : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    internal string GetUIData()
    {
        ProxyWrapper.UserProxy.UserDetails _objUser = ((ProxyWrapper.UserProxy.UserDetails)Session["UserObject"]);
        if (_objUser != null)
        {
            StringBuilder sb = new StringBuilder();
            string data = @"<li>
            <input type='checkbox' checked id='inputee1_{0}' class='inputcheckbox' name='s[]' value='{1}' />
            <label class='selectbox_label' for=inputee1_{2}'>
                <strong>{3}</strong>
            </label>
        </li>";
            ProxyWrapper.UserServiceWrapper _wrapper = new ProxyWrapper.UserServiceWrapper();
            DataSet ds = _wrapper.GetServicesList(_objUser.ClientId, _objUser.HashCode);
            object[] _obj = new object[4];
            if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                int j = 1;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    _obj[0] = j.ToString().Trim();
                    _obj[1] = ds.Tables[0].Rows[i][0].ToString().Trim();
                    _obj[2] = j.ToString().Trim();
                    _obj[3] = ds.Tables[0].Rows[i][1].ToString().Trim();
                    sb.Append(string.Format(data, _obj));
                }
            }
            return sb.ToString();
        }
        return "";
    }
}